package com.idc.excel.cr;

import com.alibaba.excel.annotation.ExcelProperty;

import lombok.Data;

@Data
public class CrData {

	@ExcelProperty("省份名称")
	private String provinceName;

	@ExcelProperty("设备类型")
	private String type;

	@ExcelProperty("设备名称")
	private String deviceName;

	@ExcelProperty("设备IP")
	private String deviceIp;

	@ExcelProperty("端口名称")
	private String portName;

	@ExcelProperty("端口描述")
	private String portDesc;

	@ExcelProperty("电路属性")
	private String circuitProperties;

	@ExcelProperty("端口IP")
	private String ipAddress;

	@ExcelProperty("带宽G")
	private String bandwidth;

	@ExcelProperty("是否合规")
	private String isCompliance;

	@ExcelProperty("是否包含上、下、互联关系")
	private String isUpDownLink;

	@ExcelProperty("是否包含省份关键字")
	private String isContainProKey;

	@ExcelProperty("是否包含地市关键字")
	private String isContainCityKey;

	@ExcelProperty("是否包含网络或业务关键字")
	private String isContainNetBusKey;

	@ExcelProperty("是否包含设备层级关键字")
	private String isContainDeviceKey;

	@ExcelProperty("是否包含带宽关键字")
	private String isContainBandwidthKey;

	@ExcelProperty("是否包含端口信息关键字")
	private String isContainPortKey;

	@ExcelProperty("备注")
	private String remark;

	@ExcelProperty("逻辑口检查")
	private String logicalCheck;

	@ExcelProperty("非业务口检查")
	private String notBusPortCheck;

	@ExcelProperty("业务平台端口判断")
	private String busPortCheck;

	@ExcelProperty("用户端口判断")
	private String userPortCheck;

	public void reloadCompliance() {
		if ("否".equals(this.isUpDownLink) || "否".equals(this.isContainProKey) || "否".equals(this.isContainCityKey) || "否".equals(this.isContainNetBusKey) || "否".equals(this.isContainDeviceKey)
				|| "否".equals(this.isContainBandwidthKey) || "否".equals(this.isContainPortKey)) {
			setIsCompliance("不合规");
		} else {
			setIsCompliance("合规");
		}
	}

	public boolean isCompliance() {
		return "合规".equals(this.isCompliance);
	}

	public boolean isBusUserCompliance() {
		return !"否".equals(this.isUpDownLink) && !"否".equals(this.isContainProKey) && !"否".equals(this.isContainCityKey);
	}

	public boolean isLogicNotBusCheck() {
		return "是".equals(this.getLogicalCheck()) || "是".equals(this.getNotBusPortCheck());
	}

}
